// MultiLevelPickerView.h
#import <UIKit/UIKit.h>

typedef void(^MultiLevelPickerCompletionBlock)(NSArray *selectedValues, NSArray *selectedIndexes);
typedef void(^MultiLevelPickerCancelBlock)(void);
typedef void(^MultiLevelPickerIndexChangedBlock)(NSInteger level, NSInteger index);
typedef void(^MultiLevelPickerDataRequestBlock)(NSInteger level, NSArray *selectedValues, void(^completion)(NSArray *data));

@interface MultiLevelPickerView : UIView

@property (nonatomic, strong, readonly) NSArray *selectedValues;  // 选中的值数组
@property (nonatomic, strong, readonly) NSArray *selectedIndexes; // 选中的索引数组
@property (nonatomic, copy) NSString *title;                      // 标题
@property (nonatomic, strong) UIColor *toolbarBackgroundColor;    // 工具栏背景色
@property (nonatomic, strong) UIColor *titleColor;                // 标题颜色
@property (nonatomic, strong) UIColor *buttonColor;               // 按钮颜色

#pragma mark - 初始化方法
- (instancetype)initWithFirstLevelData:(NSArray *)firstLevelData
                     secondLevelData:(NSArray *)secondLevelData
                      thirdLevelData:(NSArray *)thirdLevelData;

#pragma mark - 显示方法
- (void)showWithCompletion:(MultiLevelPickerCompletionBlock)completion
                   onCancel:(MultiLevelPickerCancelBlock)cancel
           indexChangedBlock:(MultiLevelPickerIndexChangedBlock)indexChanged
                requestData:(MultiLevelPickerDataRequestBlock)requestData;

#pragma mark - 便捷类方法
+ (instancetype)showPickerWithFirstLevelData:(NSArray *)firstLevelData
                         secondLevelData:(NSArray *)secondLevelData
                          thirdLevelData:(NSArray *)thirdLevelData
                                    title:(NSString *)title
                               completion:(MultiLevelPickerCompletionBlock)completion
                                onCancel:(MultiLevelPickerCancelBlock)cancel
                        indexChanged:(MultiLevelPickerIndexChangedBlock)indexChanged
                         requestData:(MultiLevelPickerDataRequestBlock)requestData;

@end
